package tech.horgee.utils;

import tech.horgee.common.MyCode;

/**
 * 断言工具
 */
public class AssertUtil {
    public static void onlyOne(int count) {
        if (count == 0) {
            throw MyCode.FAILURE.toException("操作失败，更新记录数为0");
        } else if (count > 1) {
            throw MyCode.FAILURE.toException("操作失败，多条记录符合条件");
        }
    }

    public static void updated(int count) {
        if (count == 0) {
            throw MyCode.FAILURE.toException("操作失败，更新记录数为0");
        }
    }
}
